package com.youlu.campus.web.activity;

import com.youlu.campus.activity.entity.ActivityLotteryConfig;
import com.youlu.campus.activity.entity.ActivityLotteryConfigVo;
import com.youlu.campus.activity.entity.ActivityLotteryVo;
import com.youlu.campus.activity.service.ActivityLotteryConfigService;
import com.youlu.campus.common.base.RestResult;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 抽奖配置服务接口
 */
@RestController
@RequestMapping("/api/lottery-config")
public class ActivityLotteryConfigController {

    @Autowired
    private ActivityLotteryConfigService activityLotteryConfigService;

    /**
     * 通过活动ID获取抽奖配置
     */
    @GetMapping("/find/activity")
    public QResult<ActivityLotteryVo> getByActivityId(@RequestParam String activityId) {
        ActivityLotteryVo activityLotteryVo = activityLotteryConfigService.infoByEnable(activityId);
        return QResult.success(activityLotteryVo);
    }

}
